package com.ia2014.tp.portal2.dto;

import java.io.Serializable;

/**
 * DTO de Modulo-Portal
 * @author Liliana Gonzalez
 *
 */

public class PortalDto implements Serializable{

	private static final long serialVersionUID = -8810097534010272804L;

	private Integer idModulo;
	
	private String ipAddress;
	
	private String descripcion;
	
	private String url;
	
	public PortalDto() {
		super();
		clean();
	
	}

	public PortalDto(Integer idModulo, String ipAddress, String descripcion,
			String url) {
		super();
		this.idModulo = idModulo;
		this.ipAddress = ipAddress;
		this.descripcion = descripcion;
		this.url = url;
	}
	
	public Integer getIdModulo() {
		return idModulo;
	}

	public void setIdModulo(Integer idModulo) {
		this.idModulo = idModulo;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Override
	public String toString() {
		return "PortalDto [idModulo=" + idModulo + ", ipAddress=" + ipAddress
				+ ", descripcion=" + descripcion + ", url=" + url + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((descripcion == null) ? 0 : descripcion.hashCode());
		result = prime * result
				+ ((idModulo == null) ? 0 : idModulo.hashCode());
		result = prime * result
				+ ((ipAddress == null) ? 0 : ipAddress.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PortalDto other = (PortalDto) obj;
		if (descripcion == null) {
			if (other.descripcion != null)
				return false;
		} else if (!descripcion.equals(other.descripcion))
			return false;
		if (idModulo == null) {
			if (other.idModulo != null)
				return false;
		} else if (!idModulo.equals(other.idModulo))
			return false;
		if (ipAddress == null) {
			if (other.ipAddress != null)
				return false;
		} else if (!ipAddress.equals(other.ipAddress))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	/**
	 * Limpia el Objeto Dto
	 */
	public void clean(){
		this.descripcion="";
		this.idModulo=0;
		this.ipAddress="";
		this.url="";
		
	}
	
	

}
